/*
 * Copyright (c) 2020-2099 the original author or authors. All rights reserve.
 */
package org.tianyun.cloud.test.datasource;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.tianyun.cloud.datasource.annotation.RoutingWith;
import org.tianyun.cloud.dashboard.service.MasterDatabaseTestService;
import org.tianyun.cloud.dashboard.service.SlaveDatabaseTestService;
import org.tianyun.cloud.test.BaseTestCase;

/**
 * 数据源测试用例
 *
 * @auther ebert_chan
 */
public class DataSourceTestCase extends BaseTestCase {

    private static final Logger LOGGER = LoggerFactory.getLogger(DataSourceTestCase.class);

    @Autowired
    private MasterDatabaseTestService masterDatabaseTestService;

    @Autowired
    private SlaveDatabaseTestService slaveDatabaseTestService;

    @Test
    @RoutingWith(slave = false)
    public void testSlave() {
        LOGGER.info(slaveDatabaseTestService.get());
        LOGGER.info(masterDatabaseTestService.get());
    }

}
